import request from '../utils/request'

export function getStaticInfo(id) {
    return request({
        url: `/Data/Add?typeid=${id}`,
        method: 'get'
    })
}

export function editInfo(form) {
    return request({
        url: '/Data/Update',
        method: 'post',
        data: form
    })
}
// 不传学期 获取所有的听课数据 --> 正在进行的
export function loadListAll(status, page, limit, semester) {
    return request({
        url: `/Data/Load?status=${status}&semester=${semester}&page=${page}&limit=${limit}`,
        method: 'get'
    })
}

// 传学期,获取相关学期下面的听课记录
export function loadList(status, page, limit, semester) {
    return request({
        url: `/Data/Load?status=${status}&semester=${semester}&page=${page}&limit=${limit}`,
        method: 'get'
    })
}

export function getDetails(id) {
    return request({
        url: `/Data/Detail?id=${id}`,
        method: 'get'
    })
}

export function deletedetails(id) {
    return request({
        url: `/Data/Delete`,
        method: 'post',
        data: [id]
    })
}

export function getCount(status) {
    return request({
        url: '/Data/Count',
        method: 'post',
        data: {
            status: status
        }
    })
}
export function getHistoryCount(semester) {

    return request({
        url: '/Data/Count',
        method: 'post',
        data: {
            status: 1,
            semester: semester
        }
    })
}